#!/bin/sh
if [ $# -lt 1 ]; then
	echo "Usage:"
	echo "generate_svg.sh DIR"
	echo "Where DIR is the directory to read .svg files"
	exit 0
fi

SRC=$1
MACHINE=`uname -p -m`
# reset the file
echo $MACHINE
for i in `find $SRC -name \*.svg -type f`; do
	svg=$i
	png="`basename $i`.png"

	echo "Generating file $svg" > /dev/stdout
	esvg_loader $svg $png > /dev/null 2>&1
	ret=$?
	if [ $ret -ne 0 ]; then
		echo "file $svg failed" > /dev/stderr
	fi
done
